const httpReq = (url,type,data,header)=>{
	return new Promise((resolve,reject)=>{
		uni.showLoading({
			title:'加载中'
		})
		uni.request({
			url,
			method:type,
			data,
			header,
			dataType:"json",
			success:function(res){
				var code = res.data.code;
				if(code == 0){
					resolve(res.data)
				}else{
					reject(res.data.msg)
				}
				
			},
			fail:function(err){
				reject(err)
			},
			complete: function(){
				setTimeout(function(){
					uni.hideLoading();
				},300);
			}
		})
	})
}
export default httpReq